<!DOCTYPE html>
<html>
<head>
    <title>图标配置预览</title>
    <style>
        /* 复用index.html的样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f8fafc;
            color: #374151;
            margin: 0;
            padding: 20px;
        }
        #configContainer {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 30px;
            padding: 20px;
        }
        .category-section {
            width: 1400px;
            padding: 20px;
            background: white;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        .image-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            padding: 15px;
        }
        .config-item {
            flex: 0 0 auto;
            width: 20px;
            height: 20px;
            object-fit: contain;
            padding: 6px;
            border-radius: 6px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s ease-in-out;
        }
        .config-item:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
    </style>
</head>
<body>
    <h1>配置图标预览</h1>
    <div id="configContainer"></div>

    <script src="./config.js"></script>
    <script>
        function loadConfig() {
            const container = document.getElementById('configContainer');
            
            // 遍历config.js中的所有分类
            for (const [category, items] of Object.entries(data)) {
                const section = document.createElement('div');
                section.className = 'category-section';
                
                const title = document.createElement('h2');
                title.textContent = category.toUpperCase();
                section.appendChild(title);
                
                const grid = document.createElement('div');
                grid.className = 'image-grid';
                
                items.forEach(item => {
                    const img = new Image();
                    img.className = 'config-item';
                    img.src = item.filePath;
                    img.alt = item.fileName;
                    
                    img.onerror = function() {
                        console.error('图标加载失败:', this.src);
                        this.style.opacity = '0.3';
                    };
                    
                    grid.appendChild(img);
                });
                
                section.appendChild(grid);
                container.appendChild(section);
            }
        }
        
        loadConfig();
    </script>
</body>
</html>